home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 96000tar.z / 96000tar / 96000 / appb / b136.asm < prev    next >
Assembly Source File  |  1992-04-28  |  1KB  |  25 lines

  1. ; This program was originally published in the Motorola DSP96002 Users Manual
  2. ; and is provided under a DISCLAIMER OF WARRANTY available from Motorola DSP
  3. ; Operation, 6501 William Cannon Drive West, Austin, Texas 78735-8598.  For
  4. ; more information, refer to the DSP96002 Users Manual, Appendix B, DSP
  5. ; Benchmarks.
  6. ;
  7. ; B.1.36    Pseudorandom Number Generation  
  8. ;This pseudorandom number generator requires a 32 bit seed and returns an  unsigned 32 bit random 
  9. ;number.  There are no restrictions on the value  of the seed.  The equation for the seed is:  
  10. ;    seed = (69069*seed + 1) mod 2**32 
  11. ;
  12. ;              Pseudorandom Number Generation                Program    ICycles 
  13. ;                                                            Words 
  14.     move                x:seed,d0.l  ;get seed            2        2 
  15.     move                #69069,d1.l  ;get constant        2        2 
  16.     mpyu   d0,d1,d0                  ;multiply            1        1 
  17.     inc    d0                        ; +1                 1        1 
  18.     move                d0.l,x:seed  ;mod 2**32, new seed 2        2 
  19. ;                                                         ---      --- 
  20. ;                                                 Totals:  8        8 
  21.  
  22. ;The resulting unsigned pseudorandom integer number is in d0.l.  
  23. ;Reference: VAX/VMS Run-Time Library Routines Reference Manual, 
  24. ;           Volume 8C, p. RTL-433. 
  25.